<%= form_for(@event) do |f| %>
  <% if @event.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@event.errors.count, "error") %> prohibited this event from being saved:</h2>

      <ul>
      <% @event.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </div>
  <% end %>
  
  <div class="field">
    <%= f.label :name %><br />
    <%= f.text_field :name %>
  </div>
  
 <div class="field">
    <%= f.label :author %><br />
    <%= session[:user].first_name %>&nbsp;
    <%= session[:user].last_name %>
    <input type="hidden" name="event[author]" value="<%= session[:user].first_name + ' ' + session[:user].last_name %>"/>
  </div>

  <%= "Date" %><br />
  <%= f.date_select 'starts_at', :use_month_numbers => false %><br />

  <%= "Time" %><br />
  <%= f.time_select 'starts_at', :ignore_date => true %><br />
  
     <div class="field">
    <%= f.label :location %><br />
    <%= f.text_field :location %>
  </div>

  <div class="field">
    <%= f.label :description %><br />
    <%= f.text_area :description %>
  </div>

  <div class="actions">
    <%= f.submit %>
  </div>
<% end %>
